package cn.wikiflyer.beikang.act.cart;

import net.tsz.afinal.annotation.view.ViewInject;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.TextView;
import cn.wikiflyer.beikang.BaseActivity;
import cn.wikiflyer.beikang.R;
import cn.wikiflyer.beikang.act.user.UserOrderListAct;
import cn.wikiflyer.beikang.act.user.bean.BKOrderInfoBean;

/**
 * 支付结果界面（成功、失败）
 */
public class PaySuccessAct extends BaseActivity {
	private LinearLayout ll_myorder;

	@ViewInject(id = R.id.click_back, click = "onClick")
	private View clickBack;
	@ViewInject(id = R.id.tv_result)
	private TextView tv_result;
	@ViewInject(id = R.id.tv_orderNo)
	private TextView tv_orderNo;

	@ViewInject(id = R.id.jine)
	private TextView jine;

	@ViewInject(id = R.id.count)
	private TextView count;

	private BKOrderInfoBean mOrderInfoBean;
	String cost;
	String countStr;

	@Override
	public void getIntentData(Bundle savedInstanceState) {
		super.getIntentData(savedInstanceState);
		mOrderInfoBean = (BKOrderInfoBean) getIntent().getSerializableExtra(
				"orderinfoBean");
		cost = getIntent().getStringExtra("cost");
		countStr = getIntent().getStringExtra("count");
	}

	public void onClick(View view) {
		// if (view.getId() == clickBack.getId()) {
		// finish();
		// }
	}

	@Override
	public void loadXml() {
		setContentView(R.layout.bk_act_pay_success_lay);
	}

	@Override
	public void init() {
		ll_myorder = (LinearLayout) findViewById(R.id.ll_myorder);

		ll_myorder.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startActivity(new Intent(ctx, UserOrderListAct.class));
				activity.finish();
			}
		});

		getHeader().setLeftAsBack();
	}

	@Override
	public void setData() {
		if (mOrderInfoBean != null) {
			tv_orderNo.setText("" + mOrderInfoBean.orderno);
			jine.setText("" + cost);
			count.setText(""+countStr);

		}
	}

}
